package com.cqupt.mapper;

import com.cqupt.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {
    @Select("select * from student")
    public abstract List<Student> selectAll();

    @Insert("insert into student values (#{id},#{name},#{age})")
    public abstract int insertToStudent(Student stu);

    @Update("update student set name = #{name},age =  #{age} where id = #{id}")
    public abstract int updateStu(Student stu);

    @Delete("delete from student where id = #{id}")
    public abstract int deleteStu(Integer id);
}
